//
//  UIDevice+YY.m
//  YYProject
//
//  Created by FishWithoutWings on 2018/1/8.
//  Copyright © 2018年 陆文宇. All rights reserved.
//

#import "UIDevice+YY.h"
#import <sys/utsname.h>

@implementation UIDevice (YY)

+ (NSString *)deviceType {
    struct utsname systemInfo;
    uname(&systemInfo);
    NSString *platform = [NSString stringWithCString: systemInfo.machine encoding: NSASCIIStringEncoding];
    
//    if ([platform isEqualToString:@"iPhone1,1"])  return @"iPhone 2G";
//    if ([platform isEqualToString:@"iPhone1,2"])  return @"iPhone 3G";
//    if ([platform isEqualToString:@"iPhone2,1"])  return @"iPhone 3GS";
//    if ([platform isEqualToString:@"iPhone3,1"])  return @"iPhone 4";
//    if ([platform isEqualToString:@"iPhone3,2"])  return @"iPhone 4";
//    if ([platform isEqualToString:@"iPhone3,3"])  return @"iPhone 4";
//    if ([platform isEqualToString:@"iPhone4,1"])  return @"iPhone 4S";
//    if ([platform isEqualToString:@"iPhone5,1"])  return @"iPhone 5";
//    if ([platform isEqualToString:@"iPhone5,2"])  return @"iPhone 5";
//    if ([platform isEqualToString:@"iPhone5,3"])  return @"iPhone 5C";
//    if ([platform isEqualToString:@"iPhone5,4"])  return @"iPhone 5C";
//    if ([platform isEqualToString:@"iPhone6,1"])  return @"iPhone 5S";
//    if ([platform isEqualToString:@"iPhone6,2"])  return @"iPhone 5S";
//    if ([platform isEqualToString:@"iPhone7,1"])  return @"iPhone 6 Plus";
//    if ([platform isEqualToString:@"iPhone7,2"])  return @"iPhone 6";
//    if ([platform isEqualToString:@"iPhone8,1"])  return @"iPhone 6S";
//    if ([platform isEqualToString:@"iPhone8,2"])  return @"iPhone 6S Plus";
//    if ([platform isEqualToString:@"iPhone8,4"])  return @"iPhone SE";
//    if ([platform isEqualToString:@"iPhone9,1"])  return @"iPhone 7";
//    if ([platform isEqualToString:@"iPhone9,2"])  return @"iPhone 7 Plus";
//    if ([platform isEqualToString:@"iPhone10,1"]) return @"iPhone 8";
//    if ([platform isEqualToString:@"iPhone10,4"]) return @"iPhone 8";
//    if ([platform isEqualToString:@"iPhone10,2"]) return @"iPhone 8 Plus";
//    if ([platform isEqualToString:@"iPhone10,5"]) return @"iPhone 8 Plus";
//    if ([platform isEqualToString:@"iPhone10,3"]) return @"iPhone X";
//    if ([platform isEqualToString:@"iPhone10,6"]) return @"iPhone X";
//
//    if ([platform isEqualToString:@"i386"])       return @"iPhone Simulator";
//    if ([platform isEqualToString:@"x86_64"])     return @"iPhone Simulator";
    
    return platform;
}

@end
